from app import create_app, db
from config import DevelopmentConfig, IS_DEBUG, ProductionConfig


# 数据库配置
config_class = DevelopmentConfig if IS_DEBUG else ProductionConfig

# 创建应用实例
app = create_app(config_class)

if __name__ == '__main__':
    with app.app_context():
        db.create_all()

    app.run(debug=IS_DEBUG, host='0.0.0.0', port=5000)
